package com.example.strategy;

import com.example.Discount;
import com.example.fruit.Fruit;

import java.math.BigDecimal;
import java.util.List;

/**
 * 不打折策略
 */
public class StrategyA implements Strategy{
    @Override
    public BigDecimal getMoney(List<Fruit> fruitList, List<Discount> discountList) {
        BigDecimal all = new BigDecimal(0);
        for (Fruit fruit : fruitList) {
            all = all.add(fruit.getSum());
        }
        return all.setScale(2, BigDecimal.ROUND_HALF_UP);
    }
}
